﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
   public class NguoiDungBUS
    {
        public List<NguoiDungDTO> DanhSachNguoiDung()
        {
            NguoiDungDAO kq = new NguoiDungDAO();
            return kq.DanhSachNguoiDung();
        }
        public NguoiDungDTO LayNguoiDungByTenDangNhap(string tenDangNhap)
        {
            NguoiDungDAO kq = new NguoiDungDAO();
            return kq.LayNguoiDungByTenDangNhap(tenDangNhap);
        }
        public NguoiDungDTO LayNguoiDungByMaNhanVien(int maNhanVien)
        {
            NguoiDungDAO kq = new NguoiDungDAO();
            return kq.LayNguoiDungByMaNhanVien(maNhanVien);
        }
        public Boolean ThemNguoiDung(NguoiDungDTO nd)
        {
            NguoiDungDAO kq = new NguoiDungDAO();
            return kq.ThemNguoiDung(nd);

        }
        public Boolean CapNhatNguoiDung(NguoiDungDTO nd)
        {
            NguoiDungDAO kq = new NguoiDungDAO();
            return kq.CapNhatNguoiDung(nd);
        }
        public Boolean XoaNguoiDung(string tenDangNhap)
        {
            NguoiDungDAO kq = new NguoiDungDAO();
            return kq.XoaNguoiDung(tenDangNhap);

        }
       //login
        public bool DangNhap(string username, string password)
        {
            return NguoiDungDAO.DangNhap(username, password);
        }
        public static bool DoiMatKhau(string user, string pass)
        {
            return NguoiDungDAO.DoiMatKhau(user, pass);
        }
    }
}
